import React from "react";
import { Route } from "react-router-dom";
import { routerDicManagedEvent } from "./routes";
import DictionarymanagedLayout from "../DictionarymanagedLayout";

function DicManagedRoutes() {
  const renderRouter = (
    item: { path: string; component: React.ReactNode },
    index: number
  ) => {
    return <Route key={index} path={item.path} element={item.component} />;
  };

  return (
    <Route path="dic" element={<DictionarymanagedLayout />}>
      {routerDicManagedEvent.map(renderRouter)}
    </Route>
  );
}

export default DicManagedRoutes;
